package com.fengxing.ams.web.facade.mouble.order;

import java.util.List;

import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;

public interface IOrderHistoryDAO extends PagingAndSortingRepository<OrderHistoryVO, Integer>, JpaSpecificationExecutor<OrderHistoryVO>  {

	@Query(value="select * from zyt_order_history where student_id=:student_id order by create_date desc", nativeQuery=true)
	List<OrderHistoryVO> queryTimeLineByStudentId(@Param("student_id")String studentId);

	@Modifying
	@Query(value="delete from zyt_order_history where student_id in (:student_id)", nativeQuery=true)
	void deleteAllByIds(@Param("student_id")List<String> ids);
	
}
